﻿using System;
using System.IO;
using System.Windows.Forms;
using System.Xml.Xsl;

namespace XSLTransformation
{
    public partial class XMLTransformForm : Form
    {

        private XslCompiledTransform transformer;

        public XMLTransformForm()
        {
            InitializeComponent();
        }        

        private void XMLTransformForm_Load(object sender, EventArgs e)
        {
            transformer = new XslCompiledTransform();

            transformer.Load("sports.xsl");
        }

        private void transformButton_Click(object sender, EventArgs e)
        {
            transformer.Transform("sports.xml", "sports.html");

            outputTextBox.Text = File.ReadAllText("sports.html");
        }        
    }
}
